package lt.hsu.login.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Schema(description = "登录信息")
public class LoginInfo {

    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{5,10}", message = "用户名必须是5-10位字母或数字")
    @Schema(description = "用户名", example = "admin",requiredMode = Schema.RequiredMode.REQUIRED)
    private String username;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{5,10}", message = "密码必须是5-10位字母或数字")
    @Schema(description = "密码", example = "123456",requiredMode = Schema.RequiredMode.REQUIRED)
    private String password;

}
